-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify ReturnStatement to prevent a UaF #76
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: pitust <piotr@stelmaszek.com>
Signed-off-by: pitust <piotr@stelmaszek.com>
Signed-off-by: pitust <piotr@stelmaszek.com>
@@ -113,45 +113,43 @@ export class CVariableAllocation extends CTemplateBase { | |||
} | |||
|
|||
@CodeTemplate(` | |||
{#statements} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think {#statements}
was there for a reason...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know, but i know the tests pass... I removed statements because it moved it above the actual return code.
Sorry, but I cannot accept this PR in it's current form. Also, would be better to at least split out debugging stuff into a separate PR (or drop it altogether). You can of course keep it in your fork if it helps you. But I am not sure I can merge it before I fully understand why we need this extra condition in templating engine. |
Signed-off-by: pitust <piotr@stelmaszek.com>
@andrei-markeev i think that's it. It also fixes an internal bug in the templater (the prototype wasn't reassigned in the decorator). |
hey! thanks for the update and sorry for the delay with response. NY time, quite hectic 😓 I found some more cases where this problem exists. Will investigate, and get back to you! |
@andrei-markeev Are there any pending issues in this PR? If not, please merge this. |
This prevents a use after free and a valgrind error like this:
This also adds a nodejs-only environment variable DEBUG which, when set, produces a wealth of debug output (aka backtraces on every template instantiation).
Fixes #74